home *** CD-ROM | disk | FTP | other *** search
- /*
- Application.h
- Application Kit, Release 2.0
- Copyright (c) 1988, 1989, 1990, NeXT, Inc. All rights reserved.
- */
-
- #import "NSResponder.h"
- @class NSDataLinkManager;
- @class NSApplication;
- @class Speaker;
- @class NSWindow;
- @class NSPasteboard;
- @class NSEvent;
- @class Listener;
- @class NSMenu;
- @class NSWorkspace;
- @class NSDPSContext;
- @class NSImage;
-
- /* Modes passed to NSRunLoop */
- extern NSString *NSModalPanelRunLoopMode;
- extern NSString *NSEventTrackingRunLoopMode;
-
- /* Pre-defined return values for runModalFor: and runModalSession:. The system also reserves all values below these. */
- enum {
- NSRunStoppedResponse = (-1000),
- NSRunAbortedResponse = (-1001),
- NSRunContinuesResponse = (-1002)
- };
-
- extern id NSApp;
-
- /* Information used by the system during modal sessions */
- typedef struct _NSModalSession *NSModalSession;
-
- @interface NSApplication : NSResponder
- {
- NSString *appName;
- NSEvent *currentEvent;
- id windowList;
- id keyWindow;
- id mainWindow;
- id delegate;
- int *hiddenList;
- int hiddenCount;
- NSString *hostName;
- id context;
- int contextNum;
- id appListener;
- id appSpeaker;
- port_t replyPort;
- NSSize screenSize;
- short running;
- struct __appFlags {
- unsigned int hidden:1;
- unsigned int autoupdate:1;
- unsigned int active:1;
- unsigned int _hasBeenRun:1;
- unsigned int _RESERVED:7;
- unsigned int _doingUnhide:1;
- unsigned int _delegateReturnsValidRequestor:1;
- unsigned int _deactPending:1;
- unsigned int _invalidState:1;
- unsigned int _invalidEvent:1;
- } appFlags;
- id _reservedApp4;
- id _focusStack;
- id _freelist;
- id _pboard;
- id _mainMenu;
- id _appIcon;
- id _nameTable;
- id _printInfo;
- unsigned int _reservedApp1;
- unsigned int _reservedApp2;
- unsigned int _reservedApp3;
- }
-
- + (NSWorkspace *)workspace;
-
- + sharedApplication;
-
- - setDelegate:anObject;
- - delegate;
- - (NSDPSContext *)context;
- - hide:sender;
- - unhide:sender;
- - unhideWithoutActivation;
- - windowWithWindowNumber:(int)windowNum;
- - mainWindow;
- - keyWindow;
- - (BOOL)isActive;
- - (BOOL)isHidden;
- - (BOOL)isRunning;
- - deactivateSelf;
- - (int)activateIgnoringOtherApps:(BOOL)flag;
- - (void)run;
- - (int)runModalFor:theWindow;
- - stop:sender;
- - stopModal;
- - stopModalWithCode:(int)returnCode;
- - (void)abortModal;
- - (NSModalSession)beginModalSessionForWindow:theWindow;
- - (int)runModalSession:(NSModalSession)session;
- - endModalSession:(NSModalSession)session;
- - terminate:sender;
-
- - (NSEvent *)nextEventMatchingMask:(unsigned int)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag;
- - (void)discardEventsMatchingMask:(unsigned int)mask beforeEvent:(NSEvent *)lastEvent;
- - (void)postEvent:(NSEvent *)event atStart:(BOOL)flag;
- - (NSEvent *)currentEvent;
-
- - sendEvent:(NSEvent *)theEvent;
- - preventWindowOrdering;
- - makeWindowsPerform:(SEL)aSelector inOrder:(BOOL)flag;
- - (NSArray *)windows;
- - updateWindows;
- - (BOOL)sendAction:(SEL)theAction to:theTarget from:sender;
- - calcTargetForAction:(SEL)theAction;
- - (BOOL)tryToPerform:(SEL)anAction with:anObject;
- - setMainMenu:aMenu;
- - mainMenu;
- - (void)setApplicationIconImage:(NSImage *)image;
- - (NSImage *)applicationIconImage;
-
- - validRequestorForSendType:(NSString *)sendType andReturnType:(NSString *)returnType;
-
- - (void)reportException:(NSException *)theException;
-
- @end
-
- @interface NSApplication(WindowsMenu)
- - windowsMenu;
- - setWindowsMenu:(id)menu;
- - arrangeInFront:sender;
- - removeWindowsItem:(id)win;
- - addWindowsItem:(id)win title:(NSString *)aString filename:(BOOL)isFilename;
- - changeWindowsItem:(id)win title:(NSString *)aString filename:(BOOL)isFilename;
- - updateWindowsItem:(id)win;
- - miniaturizeAll:sender;
- @end
-
-
- @interface NSObject(NSApplicationNotification)
- - applicationWillInitialize:(NSNotification *)notification;
- - applicationDidInitialize:(NSNotification *)notification;
- - applicationWillHide:(NSNotification *)notification;
- - applicationDidHide:(NSNotification *)notification;
- - applicationDidUnhide:(NSNotification *)notification;
- - applicationWillBecomeActive:(NSNotification *)notification;
- - applicationDidBecomeActive:(NSNotification *)notification;
- - applicationWillResignActive:(NSNotification *)notification;
- - applicationDidResignActive:(NSNotification *)notification;
- - applicationWillUpdate:(NSNotification *)notification;
- - applicationDidUpdate:(NSNotification *)notification;
- @end
-
- @interface NSObject(ApplicationDelegate)
- - applicationShouldTerminate:sender;
- - (int)application:sender openFile:(NSString *)filename;
- - (int)application:sender openTempFile:(NSString *)filename;
- - (BOOL)application:sender openFileWithoutUI:(NSString *)filename;
- @end
-
- @interface NSApplication(ServicesMenu)
- - servicesMenu;
- - setServicesMenu:aMenu;
- - registerServicesMenuSendTypes:(NSArray *)sendTypes andReturnTypes:(NSArray *)returnTypes;
- @end
-
- @interface NSApplication(NXAlphaImport)
- - setIgnoresAlpha:(BOOL)flag;
- - (BOOL)doesImportAlpha;
- @end
-
- @interface NSObject(NXServicesRequests)
- - (BOOL)writeSelectionToPasteboard:pboard types:(NSArray *)types;
- - readSelectionFromPasteboard:pboard;
- @end
-
- @interface NSApplication(NSServicesHandling)
- - (void)setServicesProvider:(id)provider;
- - (id)servicesProvider;
- @end
-
- /*
- * Functions to enable/disable Services Menu items. These should usually
- * only be called by service PROVIDERS (since they are the only ones who
- * know the name of the services, requestors don't). The itemName in the
- * two functions below is the language-independent "Menu Item:" entry in
- * the __services section (which all provided services must have). The
- * set function returns whether it was successful.
- * NXUpdateDynamicServices() causes the services information for the
- * system to be updated. This will only be necessary if your program
- * adds dynamic services to the system (i.e. services not found in macho
- * segments of executables).
- */
-
- extern BOOL NSShowsServicesMenuItem(NSString * itemName);
- extern int NSSetShowsServicesMenuItem(NSString * itemName, BOOL enabled);
- extern void NSUpdateDynamicServices(void);
- extern BOOL NSPerformService(NSString *itemName, NSPasteboard *pboard);
-
- /* Notifications */
- extern NSString *NSApplicationDidBecomeActiveNotification;
- extern NSString *NSApplicationDidHideNotification;
- extern NSString *NSApplicationDidFinishLaunchingNotification;
- extern NSString *NSApplicationDidResignActiveNotification;
- extern NSString *NSApplicationDidUnhideNotification;
- extern NSString *NSApplicationDidUpdateNotification;
- extern NSString *NSApplicationWillBecomeActiveNotification;
- extern NSString *NSApplicationWillHideNotification;
- extern NSString *NSApplicationWillFinishLaunchingNotification;
- extern NSString *NSApplicationWillResignActiveNotification;
- extern NSString *NSApplicationWillUnhideNotification;
- extern NSString *NSApplicationWillUpdateNotification;
- extern NSString *NSApplicationWillTerminateNotification;
-
-